/*
 * FramePreguntasAfectivo.java
 *
 * Created on 28 de mayo de 2009, 0:44
 */

package GUI;

import java.io.FileNotFoundException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;

/**
 *
 * @author  David
 */
public class FramePreguntasAfectivo extends JFrame {
    
    private JFrame framePadre;

    /** Creates new form FramePreguntasAfectivo */
    public FramePreguntasAfectivo(JFrame fr) {
        this.setVisible(true);
        this.framePadre=fr;
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabelAfectivo = new javax.swing.JLabel();
        jComboBox_Preguntas = new javax.swing.JComboBox();
        jButtonVolver = new javax.swing.JButton();
        jButtonAsesorar = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabelAfectivo.setText("Asesoramiento Afectivo");

        jComboBox_Preguntas.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Ayuda", "Consejos" }));

        jButtonVolver.setText("Volver");
        jButtonVolver.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonVolverActionPerformed(evt);
            }
        });

        jButtonAsesorar.setText("Asesorar");
        jButtonAsesorar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAsesorarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(104, 104, 104)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jComboBox_Preguntas, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jButtonVolver)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 42, Short.MAX_VALUE)
                        .addComponent(jButtonAsesorar)))
                .addContainerGap(116, Short.MAX_VALUE))
            .addGroup(layout.createSequentialGroup()
                .addGap(136, 136, 136)
                .addComponent(jLabelAfectivo, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(133, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(56, 56, 56)
                .addComponent(jLabelAfectivo)
                .addGap(27, 27, 27)
                .addComponent(jComboBox_Preguntas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(49, 49, 49)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonAsesorar)
                    .addComponent(jButtonVolver))
                .addContainerGap(111, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void jButtonVolverActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonVolverActionPerformed
    this.setVisible(false);     
    this.framePadre.setVisible(true);
}//GEN-LAST:event_jButtonVolverActionPerformed

private void jButtonAsesorarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAsesorarActionPerformed
    int indice =jComboBox_Preguntas.getSelectedIndex();
    switch ( indice ) {
      case 0:
                
        this.setVisible(false);
        try {
            JFrame fram = new FramePreguntaAfectivoAyuda(this);
        } catch (Exception ex) {
            Logger.getLogger(FramePreguntasTecnico.class.getName()).log(Level.SEVERE, null, ex);
        }
           break;
      case 1:
        this.setVisible(false);
        try {
            JFrame fram = new FramePreguntaAfectivoConsejos(this);
        } catch (Exception ex) {
            Logger.getLogger(FramePreguntasTecnico.class.getName()).log(Level.SEVERE, null, ex);
        }
       
           break;
     
      default:
           System.out.println("error" );
           break;
      }
}//GEN-LAST:event_jButtonAsesorarActionPerformed

 

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonAsesorar;
    private javax.swing.JButton jButtonVolver;
    private javax.swing.JComboBox jComboBox_Preguntas;
    private javax.swing.JLabel jLabelAfectivo;
    // End of variables declaration//GEN-END:variables

}
